#!/usr/local/bin/ruby

com_path = "/home/code4/public";
inc_path = "/home/code4/public/app/lib:/home/code4/public/app/rb"
log = com_path + "/log/cron.log";
err = com_path + "/log/cron.err";

begin
  command = "/usr/local/bin/ruby -I"+inc_path+" "+com_path+"/app/rb/batch_start.rb";
  exec(command + " >>" + log + " 2>>" + err);

rescue Exception => e
  File.open(err,'a') {|f|
    f.print "Error:\n"
    f.print e
    f.print "\n"
    f.print "backtrace:\n"
    e.backtrace{|t|
      f.print t + "\n"
    }
  }
end

